package com.netease.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.netease.domain.ShoppingCart;
import com.netease.mapper.ShoppingcartMapper;

@Service
public class ShoppingcartServiceImpl implements ShoppingcartService {
	@Autowired
	private ShoppingcartMapper ShoppingcartMapper;

	@Override
	public List<ShoppingCart> findAll(int pageNo) {
		return ShoppingcartMapper.findAll(pageNo);
	}
	
	@Override
	public List<ShoppingCart> findAllByUserId(String user_id) {
		return ShoppingcartMapper.findAllByUserId(user_id);
	}

	@Override
	public ShoppingCart findOne(String id) {
		return ShoppingcartMapper.findOne(id);
	}

	@Transactional
	public void save(ShoppingCart info) {
		ShoppingcartMapper.save(info);
	}
	
	@Transactional
	public void update(ShoppingCart info) {
		ShoppingcartMapper.update(info);
	}
	
	@Transactional
	public void delete(String id) {
		ShoppingcartMapper.delete(id);
	}

	@Override
	public int findCount() {
		return ShoppingcartMapper.findCount();
	}
}
